<?php
session_start();
require '../nette/Nette/loader.php';
require '../db.php';
require '../localization/lang.php';
require '../core/core.sanitizer.php';
require '../core/core.security.php';
require '../core/core.dfs.php';
require '../visual/visual.dfs.php';
require '../core/core.time.php';
require '../core/core.usermanagement.php';

$login=new core_security;
if ($login->checklogin()=="OK" AND $_SESSION['role']<1) {


if ($_SESSION['role'] < 1 ) {
$loc = new loc;
$user = new core_user;
$user->setid($_POST['id']);
$user->login=$_POST['value'];
echo $user->edituser_validate();
$result=mysql_query("select * from users WHERE login='".$user->login."'");
	if ($result != "") {
	$row=mysql_fetch_array($result);
	if (isset($row['name'])) {
			echo "<br>".$loc->validation_adduser_loginalreadyexist; 
			} else {$user->edituser();}
		}


echo $_POST['value'];


}
}
